#ifndef INCLUDE_MM_H_
#define INCLUDE_MM_H_
#include "type.h"

 
#define PTE_NUM 128 //128项页表项，支持0-0x80000的地址空间
#define PFRAME_NUM 128

#define PTE_C            2 //Cache
#define PTE_D            1 //Dirty
#define PTE_V            1 //Valid
#define PTE_G            1 //Global

typedef struct PTE
{
    uint32_t pte;
    int valid;
}PTE_t;  

PTE_t pgtable[PTE_NUM];
typedef struct pframe
{
    uint32_t pfn;
    uint32_t valid;
}pframe_t;
pframe_t pframe_table[PFRAME_NUM];

void init_page_table();
void do_TLB_helper();
void init_TLB(void);
void physical_frame_initial(void);
void recycle_pframe(uint32_t pfn);

#endif
